package javaClassExercise.designPatterns.builderModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lomo.
 *
 * Builder -> 建造者模式，将多个功能集合到一个类中
 *
 * 建造者模式关注创建符合的对象，而工厂模式关注点是创建单个功能模块产品的类对象
 *
 */
public class Builder {
    private List<Sender> list = new ArrayList<Sender>();

    public List<Sender> produceMailSender(int count) {
        for (int i=0; i<count; i++) {
            list.add(new MailSender());
        }
        return list;
    }

    public List<Sender> produceSmsSender(int count) {
        for (int i=0; i<count; i++) {
            list.add(new SmsSender());
        }
        return list;
    }

//    public void produceMailSender(int count) {
//        for (int i=0; i<count; i++) {
//            list.add(new MailSender());
//        }
//    }
//
//    public void produceSmsSender(int count) {
//        for (int i=0; i<count; i++) {
//            list.add(new SmsSender());
//        }
//    }
}
